package utils
{
	import model.GoogleGeoResult;
	
	import mx.collections.ArrayList;

	/**
	 * Google位置地址解析
	 **/
	public class GoogleLocationParser
	{
		private var xmlData:XML = null;
		public function GoogleLocationParser(xmlData:XML)
		{
			this.xmlData = xmlData;
		}
		
		/**
		 * 获取返回状态
		 **/
		public function getStatus():Boolean
		{
			return (this.xmlData.status=="OK");
		}
		
		public function getResultList():ArrayList
		{
			var outList:ArrayList = new ArrayList();
			var xmlList:XMLList = this.xmlData.result;
			for(var ii:int=0;ii<xmlList.length(); ii++)
			{
				var item:XML = xmlList[ii];
				outList.addItem(new GoogleGeoResult(item));
			}
			return outList;
		}
	}
}